package com.itheima.demo4;

public class Demo {

}
abstract  class  Animal{
    public abstract void eat();
}
class Dog extends Animal{

    public void eat() {
        System.out.println("狗吃骨头");
    }
    //多态子类方法
    public void lookHome(){
        System.out.println("狗子会看家");
    }
}
class Cat extends Animal{

    public void eat() {
        System.out.println("猫吃老鼠");
    }
}
class Pig extends Animal{

    public void eat() {
        System.out.println("猪拱大白菜");
    }
}